package com.appspot.bs24event.controller.event.attendance;

import org.slim3.controller.BaseController;
import org.slim3.controller.Navigation;

import com.appspot.bs24event.service.AttendanceService;

public class DeleteController extends BaseController {

    private AttendanceService service = new AttendanceService();

    @Override
    protected Navigation setUp() {
        logger.info(this.getClass().getName() + " start.");
        return super.setUp();
    }

    @Override
    protected void tearDown() {
        logger.info(this.getClass().getName() + " end.");
        super.tearDown();
    }

    @Override
    public Navigation run() throws Exception {

        service.delete(asKey("key"), asLong("version"));

        return redirect("/event/attendance/detail?key="+ request.getParameter("eventKey") + "&version=" + request.getParameter("eventVersion"));
    }
}
